<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //构造函数：专门生成对象的函数
    //所有单词的首字母都大写
    function CreateMovie(movieName,type,rate,showTime){
        this.movieName = movieName;
        this.type = type;
        this.rate = rate;
        this.showTime = showTime;
        this.getNextShowing = function(){
            var current  = 11;
            for(var i = 0;i<this.showTime.length;i++){
                if(current < parseInt(this.showTime[i])){
                    console.log(this.movieName+"下一次播放时间"+this.showTime[i]);
                    break;
                }
            }
        }
    }

    //对象的实例化
    var movie1 = new CreateMovie("007","谍战类","9.0",["10:00","12:00","15:00"]);
    var movie2 = new CreateMovie("指环王","冒险类","9.0",["6:00","10:00","18:00"]);

    console.log(movie1);
    movie1.getNextShowing();
    console.log(movie2);
</script>
</html>